<template>
  <div class="sun">
    <h4>sun:{{ car }}</h4>
    <el-button @click="updateCar">改变爷爷组件的值</el-button>
  </div>
</template>

<script setup lang="ts">
import { inject } from "vue";
let car = inject("TOKEN");
const updateCar = () => {
  car.value = "宝马";
};
</script>

<style scoped lang="scss">
.sun {
  height: 100px;
  width: 400px;
  background: rgb(227, 115, 60);
}
</style>
